package com.atguigu.guli.service.edu.service.impl;

import com.atguigu.guli.service.edu.entity.Tests;
import com.atguigu.guli.service.edu.mapper.TestsMapper;
import com.atguigu.guli.service.edu.service.ITestsService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 杨婉莹
 * @since 2021-03-13
 */

@Service
public class TestsServiceImpl extends ServiceImpl<TestsMapper, Tests> implements ITestsService {
    @Autowired
    private TestsMapper testsMapper;

    @Override
    public List<Tests> selectTestsInfoById(String course_id) {


        List<Tests> testsList =  testsMapper.selectList(new QueryWrapper<Tests>().eq("course_id", course_id));

//        Map<String, Object> map = new HashMap<>();
//        map.put("tests", tests);
//        map.put("testsList", testsList);
        return testsList;
    }

//    @Override
//    public List<Tests> selectTestsById(String id) {
//
//
//        List<Tests> testsList =  testsMapper.selectList(new QueryWrapper<Tests>().eq("id", id));
//

//// .       Map<String, Object> map = new HashMap<>();
////        map.put("tests", tests);
////        map.put("testsList", testsList);
//        return testsList;
//    }

}
